|
CruiseControl.NET : Configure CruiseControl.Net to Automatically Update its Config File
This page last changed on Sep 06, 2007 by dcameron.
While using CC.Net the config file often has to be changed to add or remove projects or to add or remove reports. It can also be useful to keep the config file in a repository to track changes and to help get the server up and running again in case of failure. (Just last month a cruise box on my project left the team with a loud bang and a smoky smell.) Because CruiseControl.Net can already:
it's possible to configure CC.Net to automatically update its own configuration file whenever someone commits changes. Here's how: Step 1: Get your configuration file under source controlAt minimum this involves checking the file in. But there are cleaner and less clean ways to do this. Rather than checking the entire CruiseControl.Net folder in, I like to have a config folder underneath the main program folder that only has the config file in it. <configuration> ... <appSettings> <!-- Without this appSetting ccservice will look for ccnet.config in its own directory. --> <add key="ccnet.config" value="config\ccnet.config" /> ... </appSettings> ... </configuration> Step 2: Add a CruiseControl.Net project to update the config fileAt this point, someone could manually update the working copy on the cruise box when changes to the config are committed. But, we can have ccnet itself automatically perform this step by adding a project to ccnet. This project will check for changes to the configuration file in the source control repository and update it on disc. We only need a trigger block and a source control block. For the example worked above, this project would look like: <project name="cc-config"> <triggers> <intervalTrigger seconds="30" /> </triggers> <sourcecontrol type="svn"> <trunkUrl>file:///c:/Repo/sandbox/config</trunkUrl> <workingDirectory>C:\Program Files\CruiseControl.NET\server\config</workingDirectory> </sourcecontrol> </project> Now, when someone commits changes, the next time the cc-config project runs it will pull the changes on to the local disc. CruiseControl.Net will notice the changes and reload the configuration file. If you have the console visible you should see lines similar to the following:
|
| Document generated by Confluence on Mar 14, 2009 02:55 |